package com.zoweunion.mechanic.util.task;

import com.zoweunion.mechanic.service.base.PartsManagerService;
import com.zoweunion.mechanic.util.MyException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

@Component
public class PartManagerTask {
    protected Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private PartsManagerService partsManagerService;

    /**
     * 定时统计工单异常
     */
    @Scheduled(cron = "0 30 1 1/1 * ?")
    @GetMapping("/partsManageDaily")
    public void partsManageDaily() throws MyException { partsManagerService.getDailyParts(); }

}
